import request from '@/config/axios'

// 会员开通记录 VO
export interface MemberOpenLogVO {
  id: number // 主键
  userId: number // 用户id
  price: number // 交易金额(分)
  tradeNo: string // 交易号
  memberTypeId: number // 会员类型id
  remark: string // 备注
}

// 会员开通记录 API
export const MemberOpenLogApi = {
  // 查询会员开通记录分页
  getMemberOpenLogPage: async (params: any) => {
    return await request.get({ url: `/wine/member-open-log/page`, params })
  },

  // 查询会员开通记录详情
  getMemberOpenLog: async (id: number) => {
    return await request.get({ url: `/wine/member-open-log/get?id=` + id })
  },

  // 新增会员开通记录
  createMemberOpenLog: async (data: MemberOpenLogVO) => {
    return await request.post({ url: `/wine/member-open-log/create`, data })
  },

  // 修改会员开通记录
  updateMemberOpenLog: async (data: MemberOpenLogVO) => {
    return await request.put({ url: `/wine/member-open-log/update`, data })
  },

  // 删除会员开通记录
  deleteMemberOpenLog: async (id: number) => {
    return await request.delete({ url: `/wine/member-open-log/delete?id=` + id })
  },

  // 导出会员开通记录 Excel
  exportMemberOpenLog: async (params) => {
    return await request.download({ url: `/wine/member-open-log/export-excel`, params })
  }
}